/* -*- c++ -*- */
/*
 * This file is part of the SD Project.
 *
 * Authors: Cleiber Marques da Silva <cleiber@lisha.ufsc.br>
 * 			Odilson Tadeu Valle <odilson@sj.ifsc.edu.br>
 * 
 * SD Project is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; version 2 of the License.
 */

#ifndef _SEND_H_
#define _SEND_H_

#include <string>
#include <vector>
#include <map>
#include <omnithread.h>

#include "clock.h"
#include "delivery.h"
#include "window.h"
#include "recv.h"
#include "config.h"

namespace sd {
	class send : public omni_thread
	{
		private:
			void run(void *arg);
			void sendto(listener_ptr tobj, std::string first, sd::config *second, sd::clock *clock);
			void invokeOp(listener_ptr& tobj, const CORBA::Any& a);
		public:
			int argc;
			char **argv;
			sd::clock *clock;
			sd::delivery *delivery;
			sd::window *window;
			std::string id;
			std::vector<std::string> recv_ids;
			std::vector<sd::recv*> receiver;
			std::map<std::string, sd::config*> messages;
			send(int _argc, char **_argv, sd::clock *_clock, sd::delivery *_delivery, sd::window *_window, std::string _id, std::vector<std::string> ids);
			~send(){}
	};
}
#endif /* _SEND_H_ */
